package com.zxq.ai.domain.activity;

import com.zxq.ai.domain.enums.ActivityType;
import com.zxq.ai.domain.exception.ActivityIllegalityException;
import com.zxq.ai.domain.exception.ActivityTypeInvalidException;
import lombok.*;

import java.util.List;

/**
 * 【集卡模式】活动
 */
@Builder
@NoArgsConstructor
@AllArgsConstructor
@Getter
@Setter
public class CollectCardActivity extends Activity {

    private List<String> orderIds;
    private int orderThreshold;


    @Override
    public ActivityType getActivityType() {
        return ActivityType.COLLECT_CARD;
    }

    /////////////////////////////////////////////////////////////////////////
    /**
     * 活动有效性校验
     */
    @Override
    public void validityChecking() {
        super.validityChecking();

        if (orderThreshold <= 0) {
            throw new ActivityIllegalityException("集卡门槛必须大于0");
        }
        if (getActivityType() != ActivityType.COLLECT_CARD) {
            throw new ActivityTypeInvalidException(String.format("活动类型不匹配：%s:%s", id(), getActivityType()));
        }
    }

    ////////////////////////////////// IActivityManager ///////////////////////////////////////


    ///////////////////////////////// IActivityParticipant ////////////////////////////////////////



}
